<%--
  Created by IntelliJ IDEA.
  User: 梁玉杰
  Date: 2021/6/16
  Time: 17:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page isELIgnored="false" contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
        <link href="${pageContext.request.contextPath}/css/page.css" rel="stylesheet" type="text/css" />
</head>
<body>
<center>
    <h1>数据显示</h1>
        <form action="${pageContext.request.contextPath}/emp/updateAll" method="post">
           <table border="1" width="60%" cellspacing="0" cellpadding="0">
                <tr>
             <%--       <th>标号</th>
                    <th>员工名字</th>
                    <th>薪资</th>
                    <th>部门编号</th>--%>
                    <th>部门名字</th>
                </tr>

                <c:forEach items="${p.list}" var="emp" varStatus="s">
                    <tr>
            <%--            <td><input type="text" name="emps[${s.index}].id" value="${emp.id}"></td>
                        <td><input type="text" name="emps[${s.index}].eName" value="${emp.eName}"></td>
                        <td><input type="text" name="emps[${s.index}].sal" value="${emp.sal}"></td>
                        <td><input type="text" name="emps[${s.index}].did" value="${emp.did}"></td>--%>
                        <td><input type="text" name="" value="${emp.dept.dname}"></td>
                    </tr>

                </c:forEach>

           </table>

            <input type="submit" value="点击修改多条">
        </form>


    <form action="${pageContext.request.contextPath}/emp/findAll" method="post">
        <ul class="pagination">
            <li><a href="${pageContext.request.contextPath}/emp/findAll?pageNum=1">首页</a></li>

            <c:if test="${p.pageNum>1}">
                <li><a href="${pageContext.request.contextPath}/emp/findAll?pageNum=${p.pageNum-1}">上一页</a></li>
            </c:if>

            <c:forEach begin="1" end="${p.pages}" step="1" var="pageNum">
                <li><a href="${pageContext.request.contextPath}/emp/findAll?pageNum=${pageNum}">${pageNum}</a></li>
            </c:forEach>

            <c:if test="${p.pageNum<p.pages}">
                <li><a href="${pageContext.request.contextPath}/emp/findAll?pageNum=${p.pageNum+1}">下一页</a></li>
            </c:if>

            <li><a href="${pageContext.request.contextPath}/emp/findAll?pageNum=${p.pages}">末页</a></li>
            <li><a>共${p.pages }页</a></li>
            <li><a>跳到<input type="text" name="pageNum" style="width: 20px; height: 20px">页</a></li>


            <li><a><input type="submit" value="GO" /></a></li>
        </ul>
    </form>
</center>

</body>
</html>
